package com.youyi;

import com.youyi.dutyChain.DutyChainFactory;
import com.youyi.dutyChain.IHandler;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<IHandler> handlers = new ArrayList<>();
        handlers.add(new OrderHandle());
        handlers.add(new CheckOrderHandle());
        handlers.add(new DoneOrderHandle());
        DutyChainFactory<Integer ,Integer> dutyChainFactory = new DutyChainFactory(handlers);
        Integer sum  = dutyChainFactory.executeHandle(0);
        System.out.println(sum);
    }
}
